<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var person = {
        name : "han",
        age : 18,
        health : 100,
        smoke : function(){
            console.log("I am smoking");
            this.health --;
        },
        drink : function(){
            console.log("I am drink");
            this.health ++;
        }
    };
    delete person.name;

    function Test(name,age,height){
        //var this = {};        //在函数体最前面隐式的加上 this = {}
        //AO{ this : {}}
        this.name = name;      //执行  this.xxx = xxx;
        this.age = age;
        this.height = height;      //AO{ this : { this.name = "han", this.age = 18, this.height = 180 } }
        //...
        //return this;          //最后一步隐式的返回 this

        //return {};            //return {}，{ } 返回一个空对象

        //return 123;           //换成 return 123
    }
    var test = new Test("han",18,180);
    // console.log(test);      // return {}，打印{ } 返回一个空对象
    // console.log(test);      // 换成123 访问后打印：  Test {name: "han", age: 18, height: 180}
</script>
</body>
</html>
